#include "main.h"

bool render_changed;

SDL_Window *window;
SDL_Renderer *render;
SDL_Texture *display;
TTF_Font *font;

int main(int argc, char **argv) {
    /* start SDL */
    uint32_t flags = SDL_INIT_TIMER | SDL_INIT_VIDEO | SDL_INIT_EVENTS;
    if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {
        fprintf(stderr, "SDL_Init error: %s\n", SDL_GetError());
        return 1;
    }

    atexit(cleanup);

    /* init from init.c (graphics + game logic) */
    init();

    int quit = 0;
    while (!quit) {
        pre_render();
        update_crg();
        update_render();
        get_input();
        /* set to around 60fps (1000 ms/ 60 fps = 1/16 s^2/frame) */
        SDL_Delay(16);
    }

    return 0;
}